package com.hgw.Demo01_ChainOfResponsibilityPattern.Exercises16_8_4;

/**
 * Data time:2021/12/16 16:01
 * StudentID:2019112118
 * Author:hgw
 * Description:
 */
public class Client {

    public static void main(String[] args) {
        Officer banZhang,paiZhang,yingZHang,militaryCouncil;
        banZhang = new BanZhang("张磊");
        paiZhang = new PaiZhang("冯宪东");
        yingZHang = new YingZhang("黄龚伟");
        militaryCouncil = new MilitaryCouncil("军委会");

        // 创建职责链
        banZhang.setSuccessor(paiZhang);
        paiZhang.setSuccessor(yingZHang);
        yingZHang.setSuccessor(militaryCouncil);

        // 创建军情
        Mission mission1 = new Mission("北边来了", 6);
        banZhang.processRequest(mission1);

        Mission mission2 = new Mission("东边来了", 20);
        banZhang.processRequest(mission2);

        Mission mission3 = new Mission("西边来了", 48);
        banZhang.processRequest(mission3);

        Mission mission4 = new Mission("西边来了", 400);
        banZhang.processRequest(mission4);

    }

}
